package com.compty.paint.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * 商品实体
 */
@Entity
@Table(name = "t_goods")
public class Goods implements java.io.Serializable {

	private static final long serialVersionUID = -884391758874435701L;

	private Integer id;
	private String name;
	private String sn;
	private Integer brand_id;
	private Integer cat_id;
	private Integer type_id;
	private String goods_type = "normal"; // enum('normal', 'bind') default 'normal'
	private String unit;
	private Double weight;
	private Integer market_enable;
	private String image_default;
	private String image_file;
	private String brief;
	private String intro;
	private Double price;
	private Double mktprice;
	private Integer store;
	private String adjuncts;
	private String params;
	private String specs;
	private Date create_time;
	private Date last_modify;
	private Integer view_count;
	private Integer buy_count;
	private Integer disabled;
	private String page_title;
	private String meta_keywords;
	private String meta_description;
	private Integer point; // 积分
	
	private Long painting_id ;//绘画作品id
	private Painting painting;

	@Id
	@GeneratedValue
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column( name = "brand_id" )
	public Integer getBrand_id() {
		return brand_id;
	}

	public void setBrand_id(Integer brand_id) {
		this.brand_id = brand_id;
	}

	@Column( name = "brief" ,length = 100 )
	public String getBrief() {
		return brief;
	}

	public void setBrief(String brief) {
		this.brief = brief;
	}

	@Column( name = "buy_count")
	public Integer getBuy_count() {
		return buy_count;
	}

	public void setBuy_count(Integer buy_count) {
		this.buy_count = buy_count;
	}

	@Column( name = "disabled")
	public Integer getDisabled() {
		return disabled;
	}

	public void setDisabled(Integer disabled) {
		this.disabled = disabled;
	}

	@Column( name = "image_default",length = 50)
	public String getImage_default() {
		return image_default;
	}

	public void setImage_default(String image_default) {
		this.image_default = image_default;
	}

	@Column( name = "image_file",length = 50)
	public String getImage_file() {
		return image_file;
	}

	public void setImage_file(String image_file) {
		this.image_file = image_file;
	}

	@Column( name = "intro",length = 50)
	public String getIntro() {
		return intro;
	}

	public void setIntro(String intro) {
		this.intro = intro;
	}

	@Column( name = "market_enable")
	public Integer getMarket_enable() {
		return market_enable;
	}

	public void setMarket_enable(Integer market_enable) {
		this.market_enable = market_enable;
	}

	@Column( name = "meta_description",length = 100)
	public String getMeta_description() {
		return meta_description;
	}

	public void setMeta_description(String meta_description) {
		this.meta_description = meta_description;
	}

	@Column( name = "meta_keywords",length = 100)
	public String getMeta_keywords() {
		return meta_keywords;
	}

	public void setMeta_keywords(String meta_keywords) {
		this.meta_keywords = meta_keywords;
	}

	@Column( name = "mktprice")
	public Double getMktprice() {
		return mktprice;
	}

	public void setMktprice(Double mktprice) {
		this.mktprice = mktprice;
	}

	@Column( name = "name",length = 50)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column( name = "page_title",length = 50)
	public String getPage_title() {
		return page_title;
	}

	public void setPage_title(String page_title) {
		this.page_title = page_title;
	}

	@Column( name = "params",length = 20)
	public String getParams() {
		return params;
	}

	public void setParams(String params) {
		this.params = params;
	}

	@Column( name = "price")
	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	@Column( name = "sn" ,length = 50 )
	public String getSn() {
		return sn;
	}

	public void setSn(String sn) {
		this.sn = sn;
	}

	@Column( name = "type_id")
	public Integer getType_id() {
		return type_id;
	}

	public void setType_id(Integer type_id) {
		this.type_id = type_id;
	}

	@Column( name = "goods_type" ,length = 20 )
	public String getGoods_type() {
		return goods_type;
	}

	public void setGoods_type(String goodsType) {
		goods_type = goodsType;
	}

	@Column( name = "unit" ,length = 20 )
	public String getUnit() {
		return unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}

	@Column( name = "view_count" )
	public Integer getView_count() {
		return view_count;
	}

	public void setView_count(Integer view_count) {
		this.view_count = view_count;
	}

	@Column( name = "weight" )
	public Double getWeight() {
		weight = weight == null ? weight = 0D : weight;
		return weight;
	}

	public void setWeight(Double weight) {
		this.weight = weight;
	}

	@Column( name = "cat_id" )
	public Integer getCat_id() {
		return cat_id;
	}

	public void setCat_id(Integer cat_id) {
		this.cat_id = cat_id;
	}

	@Column( name = "store" )
	public Integer getStore() {
		return store;
	}

	public void setStore(Integer store) {
		this.store = store;
	}

	@Column( name = "create_time" )
	public Date getCreate_time() {
		return create_time;
	}

	public void setCreate_time(Date createTime) {
		create_time = createTime;
	}

	@Column( name = "last_modify" )
	public Date getLast_modify() {
		return last_modify;
	}

	public void setLast_modify(Date lastModify) {
		last_modify = lastModify;
	}

	@Column( name = "specs" ,length = 100)
	public String getSpecs() {
		return specs;
	}

	public void setSpecs(String specs) {
		this.specs = specs;
	}

	@Column( name = "adjuncts" ,length = 100)
	public String getAdjuncts() {
		return adjuncts;
	}

	public void setAdjuncts(String adjuncts) {
		this.adjuncts = adjuncts;
	}

	@Column( name = "point" )
	public Integer getPoint() {
		point = point == null ? 0 : point;
		return point;
	}

	public void setPoint(Integer point) {
		this.point = point;
	}

	@Column( name = "painting_id" )
	public Long getPainting_id() {
		return painting_id;
	}

	public void setPainting_id(Long paintingId) {
		painting_id = paintingId;
	}

	@Transient
	public Painting getPainting() {
		return painting;
	}

	public void setPainting(Painting painting) {
		this.painting = painting;
	}

}